

//初始化画布

const colorPicker = document.querySelector('input');
const cvs = document.querySelector('canvas')
const ctx = cvs.getContext('2d')


function init(){
    const w = 500,h = 300;
    cvs.width = w * devicePixelRatio //设置画布宽多少像素
    cvs.height = h * devicePixelRatio
    cvs.style.width = w + 'px' //设置canvas在网页上显示的宽度
    cvs.style.height = h + 'px'
}

init() // 初始化画布

const shapes = [] //用于存放绘制的图形

class Rectangle { //矩形类

}